
package com.insigma.business.qrcode.common.service.impl;


import com.insigma.business.qrcode.common.dao.CommonAttachmentDao;
import com.insigma.business.qrcode.common.dto.CommonAttachmentBSearcher;
import com.insigma.business.qrcode.common.entity.CommonAttachmentDO;
import com.insigma.business.qrcode.common.service.CommonAttachmentService;
import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("commonAttachmentService")
public class CommonAttachmentServiceImpl implements CommonAttachmentService {

    @Autowired(required = false)
    private CommonAttachmentDao commonAttachmentDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<CommonAttachmentDO> search(final CommonAttachmentBSearcher commonAttachmentBSearcher) {
        return commonAttachmentDao.search(commonAttachmentBSearcher);
    }
   
    @Override
    public CommonAttachmentDO get(final String id){
        return commonAttachmentDao.get(id);
    }

    
    @Override
    public Integer insert(final CommonAttachmentDO commonAttachmentDO){
        commonAttachmentDO.setId(sequenceGenerator.genKey(SequenceNameConstant.COMMON_ATTACHMENT_ID));
        return commonAttachmentDao.insert(commonAttachmentDO);
    }

    
    @Override
    public Integer update(final CommonAttachmentDO commonAttachmentDO){
        return commonAttachmentDao.update(commonAttachmentDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return commonAttachmentDao.delete(id,modifierType,modifierId);
    }

    @Override
    public List<CommonAttachmentDO> listExpiredFile(int time) {
        return commonAttachmentDao.listExpiredFile(time);
    }

}
